From 1abb530930be6fffbdc13ec727e4512571ff95ea Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 29 Jan 2007 17:01:53 +0000 Subject: [PATCH] Remove little-endian assumption from library code. Signed-off-by: Keir Fraser --- xen/common/lib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/common/lib.c b/xen/common/lib.c index c3e77d3cfa..2f1a005ca4 100644 --- a/xen/common/lib.c +++ b/xen/common/lib.c @@ -2,6 +2,7 @@ #include #include #include +#include /* for ctype.h */ unsigned char _ctype[] = { @@ -80,9 +81,15 @@ union uu { long sl[2]; /* as two signed longs */ unsigned long ul[2]; /* as two unsigned longs */ }; -/* XXX RN: Yuck hardcoded endianess :) */ + +#ifdef __BIG_ENDIAN +#define _QUAD_HIGHWORD 0 +#define _QUAD_LOWWORD 1 +#else /* __LITTLE_ENDIAN */ #define _QUAD_HIGHWORD 1 #define _QUAD_LOWWORD 0 +#endif + /* * Define high and low longwords. */ -- 2.30.2